<template>
  <div>child子组件</div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import type { PropType } from "vue";

// interface ObjType {
//   name: string;
//   age: number;
//   sex?: number;
// }

import type { ObjType } from "./Index.vue";

export default defineComponent({
  // props的类型的检查不需要使用ts，可以直接只用vue提供的类型检查
  props: {
    num: {
      type: Number,
      required: true,
    },
    obj: {
      type: Object as PropType<ObjType>,
    },
  },
});
</script>
